# -*- coding:utf-8 -*-
import sys
reload(sys)
sys.setdefaultencoding('utf-8')

from . import project
from flask import request,render_template
from admin_model import List_
@project.route('/search',methods=['POST'])
def search():
    query=request.form.get('search')
    datas=List_.query.filter_by(mark=1).whoosh_search(query).all()
    num=len(datas)
    return render_template('search.html',datas=datas,num=num )
